<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>debug.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">debug.js</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    <span class='nodesc'>No description.</span>
  </div>
  

        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="http://closure-library.googlecode.com/git/closure/goog/demos/debug.html">Demo</a></li>
            <li><a href="local_closure_goog_debug_debug.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/debug/debug.js">Git</a></li>
          </ol>
        </div>
</div>

<h2 class="g-first">File Location</h2>
  <div class="g-section g-tpl-20-80">
    <div class="g-unit g-first">
      <div class="g-c-cell code-label">/goog/debug/debug.js</div>
    </div>
  </div>
<hr/>


   
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.debug.catchErrors"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">catchErrors<span class="args">(<span class="arg">logFunc</span>,&nbsp;<span class="arg">opt_cancel</span>,&nbsp;<span class="arg">opt_target</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Catches onerror events fired by windows and similar objects.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">logFunc</span>
        : <span class="type">function(Object</span>)
        <div class="entryOverview">The function to call with the error
   information.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_cancel</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Whether to stop the error from reaching the
   browser.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_target</span>
        : <span class="type">Object=</span>
        <div class="entryOverview">Object that fires onerror events.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line41">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.debug.deepExpose"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">deepExpose<span class="args">(<span class="arg">obj</span>,&nbsp;<span class="arg">opt_showFn</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Creates a string representing a given primitive or object, and for an
object, all its properties and nested objects.  WARNING: If an object is
given, it and all its nested objects will be modified.  To detect reference
cycles, this method identifies objects using goog.getUid() which mutates the
object.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">obj</span>
        : <span class="type">*</span>
        <div class="entryOverview">Object to expose.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_showFn</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Also show properties that are functions (by
    default, functions are omitted).</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            A string representation of <code> obj</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line143">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.debug.enhanceError"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">enhanceError<span class="args">(<span class="arg">err</span>,&nbsp;<span class="arg">opt_message</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type">Error</span>
      </div>


     <div class="entryOverview">
       Converts an object to an Error if it's a String,
adds a stacktrace if there isn't one,
and optionally adds an extra message.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">err</span>
        : <span class="type">Error</span><span>&nbsp;|&nbsp;</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">the original thrown object or string.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_message</span>
        : <span class="type">string=</span>
        <div class="entryOverview">optional additional message to add to the
    error.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type">Error</span>&nbsp;
            If err is a string, it is used to create a new Error,
    which is enhanced and returned.  Otherwise err itself is enhanced
    and returned.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line307">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.debug.expose"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">expose<span class="args">(<span class="arg">obj</span>,&nbsp;<span class="arg">opt_showFn</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Creates a string representing an object and all its properties.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">obj</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span><span>&nbsp;|&nbsp;</span><span class="type">null</span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>
        <div class="entryOverview">Object to expose.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_showFn</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">Show the functions as well as the properties,
    default is false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            The string representation of <code> obj</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line106">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.debug.exposeArray"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">exposeArray<span class="args">(<span class="arg">arr</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Recursively outputs a nested array as a string.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">arr</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>
        <div class="entryOverview">The array.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            String representing nested array.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line199">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.debug.exposeException"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">exposeException<span class="args">(<span class="arg">err</span>,&nbsp;<span class="arg">opt_fn</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Exposes an exception that has been caught by a try...catch and outputs the
error with a stack trace.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">err</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">Error object or string.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_fn</span>
        : <span class="type">Function=</span>
        <div class="entryOverview">Optional function to start stack trace from.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            Details of exception.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line219">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.debug.fnNameResolver_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">fnNameResolver_<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Resolves functions to their names.  Resolved function names will be cached.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line590">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.debug.getFunctionName"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">getFunctionName<span class="args">(<span class="arg">fn</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Gets a function name

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">fn</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">Function to get name of.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            Function's name.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line533">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.debug.getNativeStackTrace_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">getNativeStackTrace_<span class="args">(<span class="arg">fn</span>)</span>
        </span>
        &#8658; <span>?</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">fn</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The function to start getting the trace from.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>?</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            <span class='nodesc'>No description.</span>
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line394">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.debug.getStacktrace"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">getStacktrace<span class="args">(<span class="arg">opt_fn</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Gets the current stack trace, either starting from the caller or starting
from a specified function that's currently on the call stack.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">opt_fn</span>
        : <span class="type">Function=</span>
        <div class="entryOverview">Optional function to start getting the trace from.
    If not provided, defaults to the function that called this.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            Stack trace.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line423">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.debug.getStacktraceHelper_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">getStacktraceHelper_<span class="args">(<span class="arg">fn</span>,&nbsp;<span class="arg">visited</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Private helper for getStacktrace().

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">fn</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">Function to start getting the trace from.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">visited</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>
        <div class="entryOverview">List of functions visited so far.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            Stack trace starting from function fn.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line448">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.debug.getStacktraceSimple"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">getStacktraceSimple<span class="args">(<span class="arg">opt_depth</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Gets the current stack trace. Simple and iterative - doesn't worry about
catching circular references or getting the args.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">opt_depth</span>
        : <span class="type">number=</span>
        <div class="entryOverview">Optional maximum depth to trace back to.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            A string with the function names of all functions in the
    stack, separated by \n.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line342">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.debug.deepExpose&helper"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">deepExpose&helper<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line146">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.debug.deepExpose&helper&indentMultiline"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">deepExpose&helper&indentMultiline<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line150">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.debug.makeWhitespaceVisible"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">makeWhitespaceVisible<span class="args">(<span class="arg">string</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Makes whitespace visible by replacing it with printable characters.
This is useful in finding diffrences between the expected and the actual
output strings of a testcase.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">string</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">whose whitespace needs to be made visible.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            string whose whitespace is made visible.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line568">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.debug.normalizeErrorObject"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">normalizeErrorObject<span class="args">(<span class="arg">err</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
      </div>


     <div class="entryOverview">
       Normalizes the error/exception object between browsers.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">err</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">Raw error object.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>&nbsp;
            Normalized error object.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line243">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.debug.catchErrors&oldErrorHandler"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">catchErrors&oldErrorHandler<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line43">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.debug.catchErrors&target.onerror"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.catchErrors&target.</span><span class="entryName">onerror<span class="args">(<span class="arg">message</span>,&nbsp;<span class="arg">url</span>,&nbsp;<span class="arg">line</span>,&nbsp;<span class="arg">opt_col</span>,&nbsp;<span class="arg">opt_error</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       New onerror handler for this target. This onerror handler follows the spec
according to
<a href="http://www.whatwg.org/specs/web-apps/current-work/#runtime-script-errors">http://www.whatwg.org/specs/web-apps/current-work/#runtime-script-errors</a>
The spec was changed in August 2013 to support receiving column information
and an error object for all scripts on the same origin or cross origin
scripts with the proper headers. See
<a href="https://mikewest.org/2013/08/debugging-runtime-errors-with-window-onerror">https://mikewest.org/2013/08/debugging-runtime-errors-with-window-onerror</a>


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">message</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The error message. For cross-origin errors, this
    will be scrubbed to just "Script error.". For new browsers that have
    updated to follow the latest spec, errors that come from origins that
    have proper cross origin headers will not be scrubbed.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">url</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The URL of the script that caused the error. The URL
    will be scrubbed to "" for cross origin scripts unless the script has
    proper cross origin headers and the browser has updated to the latest
    spec.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">line</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The line number in the script that the error
    occurred on.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_col</span>
        : <span class="type">number=</span>
        <div class="entryOverview">The optional column number that the error
    occurred on. Only browsers that have updated to the latest spec will
    include this.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_error</span>
        : <span class="type">Error=</span>
        <div class="entryOverview">The optional actual error object for this
    error that should include the stack. Only browsers that have updated
    to the latest spec will inlude this parameter.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether to prevent the error from reaching the browser.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line83">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.debug.setFunctionResolver"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.debug.</span><span class="entryName">setFunctionResolver<span class="args">(<span class="arg">resolver</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Set a custom function name resolver.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">resolver</span>
        : <span class="type">function(Function): string</span>
        <div class="entryOverview">Resolves functions to their
    names.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_debug_debug.js.source.html#line523">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>






      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Directory debug</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">File Reference</h2>
            <div id="sideFileIndex" rootPath="" current="/goog/debug/debug.js"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
